
/** $Id: CodecFactory.java 55 2009-05-14 12:20:00Z salbanese0080@gmail.com $ */

package org.aquiferserver.server.net;

import flex.messaging.io.SerializationContext;

/**
 * @author Seth Albanese
 *
 */
public class CodecFactory {

	public static SerializationCodec getCodec()
	{
		SerializationContext context = SerializationContext.getSerializationContext();
		context.enableSmallMessages = true;
		context.instantiateTypes = true;
		context.supportRemoteClass = true;
		context.legacyCollection = false;
		context.legacyMap = false;
		context.legacyXMLDocument = false;
		context.legacyXMLNamespaces = false;
		context.legacyThrowable = false;
		context.legacyBigNumbers = false;
		context.restoreReferences = false;
		context.logPropertyErrors = false;
		context.ignorePropertyErrors = true;
		
		Amf3Codec codec = new Amf3Codec();
		codec.setSerializationContext( context );
		return codec;
	}
	
}
